package Ctr;

import DB.TeacherDB;
import Model.Teacher;

public class TeacherCtr implements TeacherCtrIF {

    @Override
    public Teacher teacherLogin(String userName, String password) {
        TeacherDB teacherDB = new TeacherDB();
        Teacher teacher = teacherDB.findTeacher(userName, password);

        if (teacher == null) {
            throw new NullPointerException();
        }
        else {
            return teacher;
        }
    }
}
